#include "DoubleGeneralMatrix.h"
using namespace System;
using namespace ClapackNet;

int main(array<System::String ^> ^args) {

	DoubleGeneralMatrix ^ mat = gcnew DoubleGeneralMatrix(3, 3);
	DoubleGeneralMatrix ^ vec = gcnew DoubleGeneralMatrix(3, 1);

	mat[0, 0] = 8.0;
	mat[0, 1] = -1.0;
	mat[0, 2] = -4.0;
	mat[1, 0] = -4.0;
	mat[1, 1] = 1.0;
	mat[1, 2] = 4.0;
	mat[2, 0] = -9.0;
	mat[2, 1] = -6.0;
	mat[2, 2] = 4.0;

	vec[0, 0] = -6.0;
	vec[1, 0] = 10.0;
	vec[2, 0] = -9.0;

	mat->Factorize();
	mat->Solve(vec);

	for (int i = 0; i < 3; i++) {
		Console::WriteLine(vec[i, 0]);
	}
    return 0;
}
